package com.example.demo.controller;

import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/user")
@RestController
public class UserController {
    @RequestMapping(value = "/login",method = RequestMethod.POST)
    public Boolean login(String name,String password){
        if(!StringUtils.hasLength(name) || !StringUtils.hasLength(password)){
            return false;
        }
        if("admin".equals(name) && "admin".equals(password)){
            return true;
        }
        return false;
    }

}
